import { defineMock } from 'vite-plugin-mock-dev-server'
import mockjs from 'mockjs'

const users = mockjs.mock({
  "list|1-6": [
    {
      "id|+1": 1,
      "name": "@cname",
      "age|15-25": 15,
      "addr": "@city"
    }
  ]
})

export default defineMock({
  url: '/dev-api/users',
  method: 'GET',
  body: {
    code: 200,
    data: users.list,
    message: '成功了，你看咋样！'
  }
})
